import Vue from 'vue'
import router from '@/router/index.js'
Vue.directive('permission',{
  inserted:function(el,binding){
   console.log(el);
    console.log(binding); 
    const action = binding.value.action
   console.log(router.currentRoute) 
    const currentRights = router.currentRoute.meta.ah;
	console.log(currentRights);
   if(currentRights.indexOf(action)===-1){
    /* el.remove() */ /* 第一种 */
    /* el.parentNode.removeChild(el) 第二种*/
	
	/* 第三种 */
       el.disabled=true
       el.classList.add('is-disabled') 
    } 
  }
})
